<template>
	<view>
		<button @tap="chooseImage">选择照片</button>
		<button @tap="makePhoneCall">拨打电话</button>
		<button @tap="openBluetoothAdapter">打开蓝牙</button>
	</view>
</template>

<script>
 let recorderManager = null
export default {
	data() {
		return {
		}
	},
	onLoad() {
		recorderManager = uni.getRecorderManager();
	},
	methods: {
		//选择照片
		async chooseImage() {
			 /* #ifdef APP-PLUS */
			 if (!await this.$store.dispatch("permissionToast/requstPermission",
				 'READ_EXTERNAL_STORAGE')) return;
		    if (!await this.$store.dispatch("permissionToast/requstPermission",
		    				 'CAMERA')) return;
                /* #endif */
			uni.chooseImage({
				count: 1,
				sizeType: ['original', 'compressed'],
				sourceType: ['album', 'camera'],
				success: (res) => {
					
				}
			})
		},
		//拨打电话
		makePhoneCall() {
			uni.makePhoneCall({
				phoneNumber: '12345678901'
			})
		},
		//打开蓝牙
		openBluetoothAdapter() {
			uni.openBluetoothAdapter({
				success: (res) => {
					console.log('openBluetoothAdapter success', res)
				},
				fail: (res) => {
					console.log('openBluetoothAdapter fail', res)
				}
			})
		},
		
	}
}
</script>

<style></style>